<template>
  <div class="project-file">
    <el-scrollbar>
      <ul class="scheme-file-list" v-if="file.length">
        <li>
          <div class="item-name">
            <span class="img"> <SvgIcon name="wendang" /></span>
            <p>
              <span class="tit">项目启动会会议纪要项目启动会会议纪要项目启动会会议纪要</span>
            </p>
          </div>
          <div class="item-options">
            <span>查看</span>
            <span>编辑</span>
          </div>
        </li>
      </ul>
      <div v-else>
        <el-empty />
      </div>
    </el-scrollbar>
  </div>
</template>
<script setup lang="ts">
import { ref, onMounted, inject } from "vue";
const projectId = inject("projectId");
// api
import { getProjectFilesPage } from "@/api/modules/project";
// 变量
const file = ref([1]);
let params = ref({
  currentPage: 1,
  pageSize: 500,
  projectId
});
// 方法
const getProjectFilesPageFn = async () => {
  try {
    const { data } = await getProjectFilesPage(params.value);
    console.log(data);
  } catch (e) {
    console.log(e);
  }
};

onMounted(() => {
  getProjectFilesPageFn();
});
</script>
<style lang="scss" scoped>
.project-file {
  .scheme-file-list {
    box-sizing: border-box;
    display: flex;
    flex: 1;
    flex-flow: column nowrap;
    margin: 0 30px;
    li {
      box-sizing: border-box;
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: 36px;
      padding: 8px 10px;
      border-radius: 4px;
      .item-name {
        display: flex;
        flex: 1;
        width: max-content;
        overflow: hidden;
        .img {
          display: flex;
          flex: 0 0 24px;
          align-items: center;
          height: 24px;
          margin-right: 10px;
        }
        .tit {
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }
      .item-options {
        display: flex;
        flex: 0 0 60px;
        align-items: center;
        justify-content: space-between;
        font-size: 12px;
        color: #7499f8;
        span {
          cursor: pointer;
        }
      }
      p {
        display: flex;
        flex-flow: column nowrap;
        justify-content: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
    &:hover {
      background: #f4f4f4;
    }
  }
}
</style>
